<?php

/**
 * This is the model class for table "cf_composer".
 *
 * The followings are the available columns in table 'cf_composer':
 * @property string $id
 * @property string $name
 * @property string $title_seo
 * @property string $insert_by
 * @property string $update_by
 * @property string $insert_time
 * @property string $update_time
 */
class CfComposer extends CActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @param string $className active record class name.
	 * @return CfComposer the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'cf_composer';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
//			array('name, title_seo, insert_by, update_by, insert_time', 'required'),
//			array('activated_flag', 'numerical', 'integerOnly'=>true),
//			array('name, title_seo', 'length', 'max'=>255),
//			array('insert_by, update_by', 'length', 'max'=>50),
//			array('update_time', 'safe'),
//			// The following rule is used by search().
//			// Please remove those attributes that should not be searched.
//			array('id, name, title_seo, activated_flag, insert_by, update_by, insert_time, update_time', 'safe', 'on'=>'search'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'id' => 'ID',
			'name' => 'Name',
			'title_seo' => 'Title Seo',
			'insert_by' => 'Insert By',
			'update_by' => 'Update By',
			'insert_time' => 'Insert Time',
			'update_time' => 'Update Time',
		);
	}

	/**
	 * Retrieves a list of models based on the current search/filter conditions.
	 * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
	 */
	public function search()
	{
		// Warning: Please modify the following code to remove attributes that
		// should not be searched.

		$criteria=new CDbCriteria;

		$criteria->compare('id',$this->id,true);
		$criteria->compare('name',$this->name,true);
		$criteria->compare('title_seo',$this->title_seo,true);
		$criteria->compare('activated_flag',$this->activated_flag);
		$criteria->compare('insert_by',$this->insert_by,true);
		$criteria->compare('update_by',$this->update_by,true);
		$criteria->compare('insert_time',$this->insert_time,true);
		$criteria->compare('update_time',$this->update_time,true);

		return new CActiveDataProvider($this, array(
			'criteria'=>$criteria,
		));
	}
}